for i= 1:height,
    for j= 1:width,
        if I(1,i,j)== 1,
            image(i,j,1:3)=uint8([0,0,0]);
        else if I(1,i,j)== 2,
                image(i,j,1:3)= uint8([70,0,0]);
            else if I(1,i,j)== 3,
                    image(i,j,1:3)= uint8([0,140,0]);
                else if I(1,i,j)== 4,
                        image(i,j,1:3)= uint8([0,0,210]);
                    else image(i,j,1:3)== uint8([255,255,255]);
                    end
                end
            end
        end
    end
end
